/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-08
 * Time:14:46
 */
public class Text {
    public static void findTimeTable(Person person)
    {
       if(person instanceof Student)
       {
           ((Student) person).timeTable();
           ((Student) person).printMajor();
       }
       else {
           ((Teacher) person).timeTable();
           ((Teacher) person).printDepartment();
       }
    }

    public static void main(String[] args) {
        findTimeTable(new Teacher("黄","女",22));
        findTimeTable(new Student("刘","男",33));
    }
}
